import { Ref } from "vue";
interface XmlObj {
  xml: string;
}
class UserEditor {
  isEditUserShow: Ref<boolean> = ref(false);
  isEditUser: Ref<boolean> = ref(false);
  constructor() {}
  toggleEditUserShow = () => {
    this.isEditUserShow.value = !this.isEditUserShow.value;
    if (!this.isEditUserShow.value) this.isEditUser.value = false;
  };
}
class ViewBpmnXml {
  isViewXml: Ref<boolean> = ref(false);
  code = ref();
  constructor() {}
  toggleViewCode = (object: XmlObj) => {
    let { xml } = object;
    this.code.value = xml;
    this.isViewXml.value = !this.isViewXml.value;
  };
}

const userEditor = new UserEditor();
const viewBpmnXml = new ViewBpmnXml();

export { userEditor, viewBpmnXml };
export type { XmlObj };
